/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package camel.server.session;

import java.io.Serializable;

/**
 *
 * @author mac
 */
public class SessionCommandKey implements Serializable {
    private static final long serialVersionUID = 1L;
    
    private Long id;
    private Long masterSessionId;

    @Override
    public int hashCode() {
        return (((this.getId() == null) ? 0
                                                : this.getId()
                                                      .hashCode())
        ^ ((this.getMasterSessionId() == null) ? 0
                                                : this.getMasterSessionId()
                                                      .hashCode()));
    }

    @Override
    public boolean equals(Object otherOb) {
        if (this == otherOb) {
            return true;
        }

        if (!(otherOb instanceof SessionCommandKey)) {
            return false;
        }

        SessionCommandKey other = (SessionCommandKey) otherOb;

        return (((this.getId() == null) ? (other.getId() == null)
                                                : this.getId()
                                                      .equals(
                other.getId())))
        && (((this.getMasterSessionId() == null) ? (other.getMasterSessionId() == null)
                                                : this.getMasterSessionId()
                                                      .equals(
                other.getMasterSessionId())));
    }

    @Override
    public String toString() {
        return getMasterSessionId() + " #" + this.getId();
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getMasterSessionId() {
        return masterSessionId;
    }

    public void setMasterSessionId(Long session) {
        this.masterSessionId = session;
    }

}
